package top.revery.api.config;


import lombok.Getter;

/**
 * @author denghao
 * @title
 * @package  支付方式
 * @date 2019/12/10 9:24
 */
@Getter
public enum PayType {
    ZFB("ALIPAY","支付宝",  1),
    WX("WXPAY","微信", 2);

    private String payType ;
    private String name ;
    private Integer code;

    PayType(String payType, String name, int code) {
        this.payType = payType;
        this.name = name;
        this.code = code;
    }

    public static String getName(Integer code) {
        if (code != null) {
            for (PayType e : PayType.values()) {
                if (e.getCode().equals(code)) {
                    return e.getName();
                }
            }
        }
        return "";
    }

}
